Refactor Sidebar to responsive drawer pattern with mobile support#65
Merged
mnindrazaka merged 1 commit intomainfrom Apr 25, 2026
Merged
Conversation
Phase 0 - Foundation: - Add ContentContainer: max-width 1440 centered wrapper for large screens - Add ResponsiveStack: XStack that collapses to column at $md breakpoint Phase 1 - Layout Shell: - Sidebar: off-canvas Sheet drawer on mobile/tablet ($md and below), classic inline sidebar on desktop ($gtMd); visibility state lifted to Layout - Sidebar.state: remove isShown (now managed by Layout), fix SSR-unsafe window.location.pathname with typeof window guard - Navbar: add leftActionItem prop, $xs column stacking, numberOfLines+ellipsis on title for overflow safety - Layout: manage sidebar open/close state via useMedia() for viewport-aware defaults (open on desktop, closed on mobile); add hamburger button for mobile; responsive content padding ($3/$4/$5 by breakpoint); wrap children in ContentContainer https://claude.ai/code/session_01R25cNRQMhafRu4VQ7njNFL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactored the Sidebar component to support responsive layouts with a mobile-first approach. On mobile/tablet devices, the sidebar now renders as an off-canvas Sheet drawer, while desktop maintains the classic inline sidebar. Updated the Layout component to manage sidebar state and added responsive utilities.
Key Changes
Sidebar Component Refactoring
isShown,onToggle) from internal hook to parent Layout component via propssidebarContentvariable to avoid duplicationChevronsLefticon import and simplified toggle button logicuseMedia()hook for responsive breakpoint detectiondata-testidattributesLayout Component Enhancement
useStateanduseEffectleftActionItemto NavbarContentContainercomponent for max-width constraintNavbar Component Updates
leftActionItemprop to support hamburger menu buttonnumberOfLinesandellipsizeModeNew Components
ContentContainer: Centers content with max-width (1440px) constraintResponsiveStack: Responsive XStack that switches to column layout on medium screensSidebar State Hook Cleanup
isShownandonToggleButtonPressfromuseSidebarStatewindowobject accessImplementation Details
The responsive behavior uses Tamagui's
useMedia()hook to detect breakpoints:State is managed at the Layout level to coordinate sidebar visibility across the entire layout, ensuring consistent behavior across all child components.
https://claude.ai/code/session_01R25cNRQMhafRu4VQ7njNFL